#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#define CAL_SIZE64(n) ((n)/3*4+((n)%3?4:0))
#define CAL_EMAIL_SIZE64(n) (int)(((n)/3*4+((n)%3?4:0))*80.0/79.0+0.999999)

/* Translation Table as described in RFC1113 */
const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

void encodeblock( unsigned char *, unsigned char *, int);
int encode64(char *, char *, int, int);
int email_encode64(char *, unsigned char *, int, int);
void decodeblock(unsigned char *, unsigned char *);
int decode64(char *, char *, int, int);

int encode_quoted(const unsigned char* pSrc, char* pDst, int nSrcLen, int nMaxLineLen);
int decode_quoted(const char* pSrc, unsigned char* pDst, int nSrcLen);
